home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / OBJ1_2.ZIP;1 / C_FRAME.TXT < prev    next >
Encoding:
Text File  |  1992-12-22  |  3.8 KB  |  105 lines

  1. '
  2. 'Class description:
  3. '
  4. !short:Frame class structure:
  5. Class Frame:
  6. ~~~~~~~~~~~~
  7. The frame is defined on the screen, enabled is it to paint, move  and delete.
  8.  
  9. Common use:
  10. ~~~~~~~~~~~
  11. LOCAL OBJECT Frame OF Frame
  12. Frame:Init(Row,Col,RowSize,ColSize)
  13. Frame:Drag()
  14. Frame:Done()
  15.  
  16. Source code is in the C_Frame.prg
  17.  
  18. !seealso: c_loc.ngo:Loc c_box.ngo:Box c_win.ngo:Win c_window.ngo:Window c_color.ngo:Color ob_class.ngo:"Class hierarchy"
  19.  
  20. !short:~~~~~~~~~~~~~~~~~~~~~~
  21. !short:create class Frame from Loc
  22. !short:  export:
  23. !short:  var RowSize  //MaxRow()-7
  24. ^BFrame:RowSize^N: public: numeric
  25.   Actual frame height in number of rows.
  26.  
  27. !short:  var ColSize  //MaxCol()-9
  28. ^BFrame:ColSize^N: public: numeric
  29.   Actual frame width in number of columns.
  30.  
  31. !short:  var MaxRows  //MaxRow()-3
  32. ^BFrame:MaxRows^N: public: numeric
  33.   Maximal allowed frame height in rows. The method Frame:Drag() can change
  34.   the frame sizes only in the range from Frame:MinRows to Frame:MaxRows.
  35.  
  36. !short:  var MaxCols  //MaxCol()-1
  37. ^BFrame:MaxCols^N: public: numeric
  38.   Maximal allowed frame width in columns.The method Frame:Drag() can change
  39.   the frame sizes only in the range from Frame:MinCols to Frame:MaxCols.
  40.  
  41. !short:  var MinRows  //1
  42. ^BFrame:MinRows^N: public: numeric
  43.   Minimal allowed frame height in rows. The method Frame:Drag() can change
  44.   the frame sizes only in the range from Frame:MinRows to Frame:MaxRows.
  45.  
  46. !short:  var MinCols  //5
  47. ^BFrame:MinCols^N: public: numeric
  48.   Minimal allowed frame width in columns.The method Frame:Drag() can change
  49.   the frame sizes only in the range from Frame:MinCols to Frame:MaxCols.
  50.  
  51. !short:  var Screen   //""
  52. ^BFrame:Screen^N: private: character
  53.   The frame background is saved to restore the screen after its deleting.
  54.  
  55. !short:  var Color    //ListAsArray(m->Color:Edit)[nEnhanced]
  56. ^BFrame:Color^N: public: character
  57.   Frame painting color.
  58.  
  59. !short:  var Visible  //false
  60. ^BFrame:Visible^N: read-only: logical
  61.   If true, the frame is painted directly to screen, if false the frame is
  62.   hidden.
  63.  
  64. !short:  method New=FrameNew              //o:New() --> self
  65. ^BFrame:New()^N: public: return self
  66.   The object is filled with default values.
  67.  
  68. !short:  method Init=FrameInit            //o:Init(R,C,Rs,Cs,Clr) --> true
  69. ^BFrame:Init(R,C,Rs,Cs,Clr)^N: public: return true
  70.   If the parameter values are not nil, they are saved to instvar variables
  71.   of the object.
  72.  
  73. !short:  method Paint=FramePaint          //o:Paint() --> true
  74. ^BFrame:Paint()^N: public: return true
  75.   If Frame:Visible==false the frame is painted to the screen and instvar
  76.   variable Frame:Visible is set to true.
  77.  
  78. !short:  method Hide=FrameHide            //o:Hide() --> true
  79. ^BFrame:Hide()^N: public: return true
  80.   If the frame is painted to the screen, it is saved and the further screen
  81.   is refreshed.
  82.  
  83. !short:  method Move=FrameMove            //o:Move(dR,dC) --> true
  84. ^BFrame:Move(dR,dC)^N: public: return true
  85.   The frame is move to new position on the screen. The parameters dR and dC
  86.   are setting the relative move of the frame to old coordinates.
  87.  
  88. !short:  method Size=FrameSize            //o:Size(dR,dC) --> true
  89. ^BFrame:Size(dR,dC)^N: public: return true
  90.   The frame size is changed. The parameters dR and dC are setting the
  91.   relative change of the size to old values. The size change is accepted
  92.   only if the new values are in the allowed range.
  93.  
  94. !short:  method Drag=FrameDrag            //o:Drag(lCanSize) --> true/false
  95. ^BFrame:Drag(lCanSize)^N: public: return true/false
  96.   Reads the keyboard, after the users commands changes the frame size.
  97.   If there was a change it returns true otherwise false.
  98.  
  99. !short:  method Done=FrameDone            //o:Done() --> true
  100. ^BFrame:Done()^N: public: return true
  101.   If the frame is on the sreen it is saved.
  102.  
  103. !short:  endclass
  104.  
  105.